package ee.karileet.ui.catalogue.util;

import java.util.Locale;
import java.util.ResourceBundle;

public class Translations {
	/**
	 * Static string representing labels properties file name
	 */
	
	private static Locale[] locales = new Locale[] { Locale.ENGLISH,
			new Locale("et", "EE"), new Locale("ru", "RU") };

	public static Locale[] getAvailableLocales() {
		return locales;
	}

	/**
	 * Method returns appropriate resource bundle 
	 * @param Locale locale Translation locale to use 
	 * @param String fileName Bundle to read from
	 * @return ResourceBundle
	 */
	public static ResourceBundle get(Locale locale, String fileName) {
		if (locale == null) {
			locale = new Locale("et", "EE");
		}
		return ResourceBundle.getBundle(fileName, locale);
	}
}
